package com.anime.adapter;

import android.graphics.Color;

import androidx.annotation.Nullable;


import com.animes.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import model.AnimeLRYChapterModel;

public  class LRYAnimeSelectionAdapter  extends BaseQuickAdapter<AnimeLRYChapterModel.DataBean.ChapterListBean,BaseViewHolder>{

    private int index;

    public LRYAnimeSelectionAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<AnimeLRYChapterModel.DataBean.ChapterListBean> data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, AnimeLRYChapterModel.DataBean.ChapterListBean item) {


        if(index ==helper.getAdapterPosition()){


            helper.setTextColor(R.id.tv_title, Color.parseColor("#FFC0CB"));
        }else {
            helper.setTextColor(R.id.tv_title, Color.parseColor("#000000"));

        }
        helper.setText(R.id.tv_title,item.getTitle());

    }

    public void setIndex(int index) {
        this.index = index ;

    }


}
